﻿#ifndef _OI_PLSCANNER_OIPROFILEVIEW_HPP_
#define _OI_PLSCANNER_OIPROFILEVIEW_HPP_

namespace Oi
{
    namespace PLScannerCore
    {
        class CLTProfileView : public QGraphicsView
        {

        public:
            CLTProfileView(QWidget *parent = Q_NULLPTR);
            ~CLTProfileView();

            Appl::Chart* chart();

            void zoomFit();

        public:
            void drawDefectBoxes(const QList<LTBase::DefectTool>&, const QList<int>& value);
            void setName(const QString&);

        protected:
            void resizeEvent(QResizeEvent *event);
            void wheelEvent(QWheelEvent *event);
            void mousePressEvent(QMouseEvent *event);
            void mouseMoveEvent(QMouseEvent* event);
            void mouseReleaseEvent(QMouseEvent* event);
            void mouseDoubleClickEvent(QMouseEvent* event);
            void paintEvent(QPaintEvent *event);

        private:
            OI_DISABLE_COPY(CLTProfileView);
            OI_DECLARE_IMPL(CLTProfileView);

        };

        class MainProfileView : public CLTProfileView
        {

        public:
            MainProfileView(QWidget* parent = Q_NULLPTR);
            ~MainProfileView();

        public slots:
            void onSaveSetting();

        protected:
            void wheelEvent(QWheelEvent* event);
            void mouseMoveEvent(QMouseEvent* event);
            void mouseDoubleClickEvent(QMouseEvent* event);
            void hideEvent(QHideEvent* event);
            void showEvent(QShowEvent* event);

        private:
            OI_DISABLE_COPY(MainProfileView);
            OI_DECLARE_IMPL(MainProfileView);

        };

    }
}

#endif